package com.tuweiya.study.hibernate.enumerated;

import javax.persistence.*;

@Entity
@Table(name = "product_table")
public class Product {
    @Id
    @Column(name = "product_id")
    private int id ;

    @Column(name = "product_name")
    private String name ;

    @Column(name = "product_price")
    private double price ;

    /**
     * 枚举类的使用
     *  @Enumerated
     *      EnumType.STRING --> 存储的是字符串
     *      EnumType.ORDINAL --> 存储的是 数子
     */
    @Column(name = "product_type")
    @Enumerated(EnumType.STRING)
    private ProductType type;

    public ProductType getType() {
        return type;
    }

    public void setType(ProductType type) {
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
